package com.saq691.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 
 * 
 *
 * @datetime: 2022年11月07日 下午20:12:34
 * @author: sunaiqiang saq691@126.com
 * @version: 1.0
 */
@RestController
public class RedisController {
	@Autowired
	private StringRedisTemplate stringRedisTemplate;

	/**
	 * 
	 * @return
	 */
	@GetMapping("/masterSlave")
	public String masterSlave() {
		for (int i = 1; i < 10; i++) {
			stringRedisTemplate.opsForValue().set("saq" + i, "saiqiang" + i);
		}
		return HttpStatus.OK.getReasonPhrase();
	}
}
